package com.smartrm.trade.infrasturcture.mapper;

import com.smartrm.trade.infrasturcture.dataobject.TradeSlotVendingMachinePO;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/*
 * @author: houohng
 * @description:
 */
public interface TradeSlotVendingMachineMapper {

    @Select({"SELECT * from trade_slot_vending_machine where machine_id=#{machineId}"})
    TradeSlotVendingMachinePO selectOne(long machineId);

    @Update({
            "UPDATE trade_slot_vending_machine set state=#{state}, " +
                    "cur_order_id=#{curOrderId}, version=#{version} where machine_id=#{machineId} and version=#{version}-1"})
    int update(TradeSlotVendingMachinePO machine);

}
